-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ability to adjust merging behavior of configs per fields defined in configurations #152
Conversation
@urso This is just a first pass at the idea. It needs more tests to ensure that all cases are covered. Wanted to get some opinion on it before I go to far. |
I have added many tests and updated the description of the pull request, I think this is ready for a real review. |
…en when the fields are at level 0 depth.
Having a |
…rt for referencing entries in arrays by index.
@urso Have a look now. Using |
… to only allocation options when absolutely required.
Codecov Report
@@ Coverage Diff @@
## master #152 +/- ##
==========================================
+ Coverage 78.35% 78.71% +0.36%
==========================================
Files 24 24
Lines 2730 2800 +70
==========================================
+ Hits 2139 2204 +65
- Misses 434 435 +1
- Partials 157 161 +4
Continue to review full report at Codecov.
|
@urso Updated to address your comments. If you could give it another look, thanks! |
Adds the ability to adjust merging behavior of configs per fields defined in configurations.
Below is the user experience that this change provides:
This would allow a
paths
field to be replaced with any values fromother
and theprocessors
field to be appended with values fromother
. Indexes into arrays can also be used to adjust the merging behavior at that index in the array (eg.FieldAppendValues("processors.2.add_tags.tags"
).In the case that the depths of the fields are unknown but that behavior should always occur when fields of that name are reached in the merging process then the
**.{name}
selector can be used.ucfg.FieldReplaceValues("**.paths")
will ensure that replace is always performed when a field namepaths
is reached no matter its depth in the configuration. Nesting of wildcard is also supported with say"subpath.**.paths"
.Closes #151